import { _decorator, Component, Node } from 'cc';
import { BaseButton } from './BaseButton';
import { BasePanel } from '../panels/BasePanel';
const { ccclass, property } = _decorator;

@ccclass('CloseButton')
export class CloseButton extends BaseButton {
    
    buttonName: string = '关闭按钮'

    panel: BasePanel = null!

    start(): void {
        this.panel = this.node.parent.parent.getComponent(BasePanel)
    }

    click(): void {
        this.panel.close()
    }
}


